home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / text0172.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  2.2 KB  |  56 lines

  1. On 20 Apr 1997, Stephen W Williams wrote:
  2.  
  3. > To All 
  4. > Can someone help me with a small but irritating problem I am having
  5. > with a little prog I am trying to get working.
  6. > What I want to do is use AmosPro to create a file in Ram called Datapath
  7. > and then execute it with Amiga dos.
  8. > If you look at the example below it should create a file called Datapath
  9. > containing "CD workbench:data".
  10. > Now the hard part, the file should change the current directory to 
  11. > workbench:data (which does exist on my system).
  12. > But What I get is "object not found  CD failed returncode 20",
  13. > I think I have found why it doesn't run because there seems to be extra
  14. >  characters at the end of the file, I.e. the example below should create a file 
  15. > 18 characters long including Return
  16. > But the actual file is 20 long and its these extra characters that cause the 
  17. > problem, If I load the file into a Text Editor and delete the invisible 
  18. > characters at the end and resave the file  it runs fine.
  19. > So the Question how do I create a file without the extra characters?
  20. > I have tryed CHR$(13)/CHR$(10) After A$ but no luck. 
  21. > And I can remove any extra characters easily inside Amos.
  22. > a$="workbench:data"
  23. > C$="CD "
  24. > A$=C$+A$
  25. > Open Out 3,"Ram:Datapath"
  26. > Print #3,A$
  27. > Print #3,Chr$(13)
  28. > Close 3
  29. > Any help would be appreciated
  30. > Thanks Steve.
  31. > end
  32.  
  33. The way I see it the fault MUST lie in the EOL chars. AMOS writes CRLF
  34. EOLs, whereas AmigaDOS expects LF EOLS. So you might want to do the
  35. writing this way:
  36.  
  37. Open Out 3,"ram:datapath"
  38. Print#3,A$;Chr$(10);
  39. Close 3
  40.  
  41. Remember to ALWAYS use a semicolon (;) in Print# commands if you want
  42. to write AmigaDOS readable files!
  43.  
  44. /----------------------------------------------------------------------\
  45. | Joona Palaste                             |      |  |                |
  46. | palaste@cc.helsinki.fi                    |      |  |                |
  47. | G++ FR FW+ M- #20 D+ ADA N+++ W++ B OP+   |-------  -----------------|
  48. |                                           |-------  -----------------|
  49. |                                           |      |  |                |
  50. | Finland rules! =>                         |      |  |                |
  51. \----------------------------------------------------------------------/
  52.  
  53.  
  54.